<{include file="../common/header.tpl"}>
<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
            <{include file="../common/left.tpl"}>
    </td>
    <td width="87%" valign="top">
        <table width="100%" border="0" cellspacing="0">
            <tr>
                <td>
                    <div class="subnav">
                        <form name="form" method="get" action="">
                        <div class="content-menu ib-a blue line-x">
                         <a class="on" href="javascript:;"><em>管理员列表</em></a><span>|</span><a href="/webadmin/user/add"><em>添加管理员</em></a> 
                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                         <select name="group_id">
                             <option value="0">所有分组</option>
                             <{foreach $allgroup as $key => $val}>
                             <option value="<{$key}>" <{if $key==$group_id}>selected="selected"<{/if}>><{$val}></option>
                             <{/foreach}>
                         </select>
                         用户名：<input type="text" name="nickname" class="input-text" value="<{$nickname}>"><input type="submit" name="dosubmit" class="button" value="搜索">
                         </div>
                        <div class="clearbox"></div>
                    </div>
                    </form>
                    <div class="pad_10">
                        <div class="table-list">
                                <table width="100%" cellspacing="0">
                                      <thead>
                                        <tr>
                                              <th width="10%" align="left">登录名</th>
                                              <th width="10%" align="left">真实姓名</th>
                                              <th widht="10%" align="left">联系方式</th>
                                              <th width="10%" align="left">用户组</th>
                                              <th width="17%" align="left">所属项目</th>
                                              <th width="10%" align="left">最后登录IP</th>
                                              <th width="12%" align="left">最后登录时间</th>
                                              <th width="10%">管理操作</th>
                                        </tr>
                                      </thead>
                                      <tbody>
                                       <{foreach $list as $key => $val}>
                                        <tr onMouseOver="this.className='tr2'" onMouseOut="this.className='tr1'" class="tr1" id="user_<{$val.user_id}>">
                                              <td width="10%" valign="middle"><{$val.username}></td>
                                              <td width="10%" valign="middle"><{$val.truename}></td>
                                              <td width="10%" valign="middle"><{$val.phone}></td>
                                              <td width="10%" valign="middle">
                                                  <{if $allgroup[$val.group_id]}><{$allgroup[$val.group_id]}><{else}>未设置<{/if}>
                                              </td>
                                              <td width="25%" valign="middle">
                                                  <{if $val.projects}><{$val.projects}><{else}><a href="/webadmin/project/list">未设置</a><{/if}>
                                              </td>
                                              <td width="10%" valign="middle"><{$val.login_ip}></td>
                                              <td width="15%" valign="middle"><{$val.login_time}></td>
                                              <td width="10%" align="center" valign="middle">
                                                  <a href="/webadmin/user/edit?user_id=<{$val.user_id}>">修改权限</a> | 
                                                  <a href="javascript:" onclick="del('<{$val.user_id}>')">删除</a>
                                              </td>
                                        </tr>
                                        <{/foreach}>
                                      </tbody>
                                </table>
                                <div style="float:right;"><{$page}></div>
                        </div>
                      </div>
                </td>
            </tr>
        </table>
    </td>
 </tr>
</table>
<script type="text/javascript">
function del(user_id){
    if(confirm('确定要删除此用户？')){
        $.getJSON('/webadmin/user/del',{user_id:user_id},function(res){
            alert(res.note);
            if(res.status==1){
               $('#user_'+user_id).remove();
            }
        });
    }
}
</script>
<{include file="../common/footer.tpl"}>